Renamed Oid::as_u32 to to_u32#2011
Conversation
|
This doesn't conform to the Rust API guidelines. "Conversions prefixed as_ and into_ typically decrease abstraction, either exposing a view into the underlying representation (as) or deconstructing data into its underlying representation (into). |
|
Hard to disagree, but there are many uses of |
|
Though maybe it's better to ask @workingjubilee first to avoid unnecessary changes. |
|
I appreciate the effort but I don't think this is a change we should make now. Perhaps when we get ready for a larger v0.14.0 with some breaking changes this could make sense, but in our current v0.13.x release series it seems like it'll be more detrimental to users than helpful. |
|
The thing here is that we need to decide how the method should be named as #2003 also does that too. As long as you are here, decide what's the correct option. |
eeeebbbbrrrr
left a comment
There was a problem hiding this comment.
I'm good with this. Thanks
The reason behind that is that `as_*` methods doesn't consume `self` but a reference, and `to_*` methods do conversion by consuming `self`.
PostgreSQL 12 has been unsupported for over half a year, and pgrx v0.14.0 officially dropped support for it. The other reason I propose this version bumping is that pgrx v0.12.9 failed to install pg 12 on my mac. This patch removes PG12 support from the wrappers by upgrading pgrx to v0.14.3. Some code adjustments were required due to changes introduced in the newer pgrx versions. For reference, see the following updates in pgrx: - [force using extern "C-unwind" for functions marked with `#[pg_guard]`][1] - [Made SPI query arguments type safe][2] - [Added connect_mut for data changing SPI operations][3] - [Renamed Oid::as_u32 to to_u32][4] [1] pgcentralfoundation/pgrx#2014 [2] pgcentralfoundation/pgrx#1858 [3] pgcentralfoundation/pgrx#1913 [4] pgcentralfoundation/pgrx#2011 Signed-off-by: Junwang Zhao <[email protected]>
PostgreSQL 12 has been unsupported for over half a year, and pgrx v0.14.0 officially dropped support for it. The other reason I propose this version bumping is that pgrx v0.12.9 failed to install pg 12 on my mac. This patch removes PG12 support from the wrappers by upgrading pgrx to v0.14.3. Some code adjustments were required due to changes introduced in the newer pgrx versions. For reference, see the following updates in pgrx: - [force using extern "C-unwind" for functions marked with `#[pg_guard]`][1] - [Made SPI query arguments type safe][2] - [Added connect_mut for data changing SPI operations][3] - [Renamed Oid::as_u32 to to_u32][4] [1] pgcentralfoundation/pgrx#2014 [2] pgcentralfoundation/pgrx#1858 [3] pgcentralfoundation/pgrx#1913 [4] pgcentralfoundation/pgrx#2011 Signed-off-by: Junwang Zhao <[email protected]>
* chore: bump pgrx to v0.14.3 PostgreSQL 12 has been unsupported for over half a year, and pgrx v0.14.0 officially dropped support for it. The other reason I propose this version bumping is that pgrx v0.12.9 failed to install pg 12 on my mac. This patch removes PG12 support from the wrappers by upgrading pgrx to v0.14.3. Some code adjustments were required due to changes introduced in the newer pgrx versions. For reference, see the following updates in pgrx: - [force using extern "C-unwind" for functions marked with `#[pg_guard]`][1] - [Made SPI query arguments type safe][2] - [Added connect_mut for data changing SPI operations][3] - [Renamed Oid::as_u32 to to_u32][4] [1] pgcentralfoundation/pgrx#2014 [2] pgcentralfoundation/pgrx#1858 [3] pgcentralfoundation/pgrx#1913 [4] pgcentralfoundation/pgrx#2011 Signed-off-by: Junwang Zhao <[email protected]> * run cargo fmt Signed-off-by: Junwang Zhao <[email protected]> * bump ci cargp-pgrx version Signed-off-by: Junwang Zhao <[email protected]> --------- Signed-off-by: Junwang Zhao <[email protected]>
The reason behind that is that `as_*` methods doesn't consume `self` but a reference, and `to_*` methods do conversion by consuming `self`.
The reason behind that is that
as_*methods doesn't consumeselfbut a reference, andto_*methods do conversion by consumingself.